#include<iostream>
#include"Clock.h"

class NewClock:public Clock
{
public:
	NewClock(int h, int m, int s):Clock(h,m,s){}
	Clock* createNewClock(int h, int m, int s);
	void showTime();
};

Clock* Clock::createNewClock(int h, int m, int s) {
	return new NewClock(h, m, s);
}
void NewClock::showTime()
{	
	int tmp_hour;
	if (getHour() < 12)
	{
		cout << "Now:" << getHour() << ":" << getMinute() << ":" << getSecond() << "AM" << endl;
	}
	else
	{
		tmp_hour = getHour() - 12;
		cout << "Now:" << tmp_hour << ":" << getMinute() << ":" << getSecond() << "PM" << endl;
	}
		
}

int main()
{
	NewClock nc(23, 4, 5);
	nc.showTime();
}